package GUI;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JTextField;
import javax.swing.JButton;

import Client.BusinessImplements;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.Font;
import javax.swing.JLabel;
import java.awt.Color;
import java.awt.SystemColor;
import javax.swing.border.LineBorder;
public class Put_Id_for_Extend extends Abstract_Jpanel {
	private JTextField textField;
	private JButton btnNewButton;
	private Extend_Item_Panel extend_item;
	
	
	public Put_Id_for_Extend() {
		
		btnNewButton = new JButton("Search");
		btnNewButton.setBounds(341, 223, 88, 42);
		btnNewButton.setFont(new Font("Tahoma", Font.PLAIN, 14));
		btnNewButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				String st = getUserId();
				if (!st.equals("")){
				extend_item=new Extend_Item_Panel();
				on_screen_unload();
				BusinessImplements.GetInstance().getMainFrame().setContentPane(extend_item);
				extend_item.setUserId(getUserId());
				extend_item.setSize(getMaximumSize());
				extend_item.on_screen_load();
				}
				else
					JOptionPane.showMessageDialog(null,"Please put ID");
				
				
			}
		});
		setLayout(null);
		add(btnNewButton);
		
		JPanel panel = new JPanel();
		panel.setBorder(new LineBorder(SystemColor.activeCaption, 6));
		panel.setBackground(SystemColor.inactiveCaption);
		panel.setBounds(20, 47, 420, 165);
		add(panel);
		panel.setLayout(null);
		
		textField = new JTextField();
		textField.setBounds(120, 52, 188, 20);
		panel.add(textField);
		textField.setColumns(10);
		
		JLabel lblUserId = new JLabel("member Id:");
		lblUserId.setFont(new Font("Tahoma", Font.PLAIN, 14));
		lblUserId.setBounds(31, 50, 79, 20);
		panel.add(lblUserId);
		
		JLabel lblChoseUserId = new JLabel("Choose Member ID  ");
		lblChoseUserId.setForeground(new Color(25, 25, 112));
		lblChoseUserId.setFont(new Font("MV Boli", Font.BOLD, 30));
		lblChoseUserId.setBounds(72, 0, 368, 50);
		add(lblChoseUserId);
	}

	
	
	public String getUserId ()
	{
		String str;
		str = this.textField.getText();
		return str;
	}
	
	
	
	
	@Override
	public void next_screen() {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void prev_screen() {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void on_screen_load() {
		// TODO Auto-generated method stub
	}
	@Override
	public void on_screen_unload() {
		// TODO Auto-generated method stub
		
	}
}
